<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>UploadiFive Test</title>
	<script src="plugin/jquery/jquery-3.1.0.min.js" type="text/javascript"></script>
	<script src="plugin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="plugin/uploadify/uploadify.css">
	<style type="text/css">
	body {
		font: 13px Arial, Helvetica, Sans-serif;
	}
	</style>
</head>

<body>
	<h1>Uploadify Demo</h1>
	<form>
		<div id="queue"></div>
		<input id="file_upload" name="file_upload" type="file">
		<div id="fileQueue"></div>
	</form>

	<script type="text/javascript">
		$(function() {
			$('#file_upload').uploadify({
				buttonText		: '选择文件',				
				height     		: 30,
				width     		: 120,
				swf      		: 'plugin/uploadify/uploadify.swf',
				uploader 		: 'UploadifyServlet',
				cancelImg		: 'plugin/uploadify/uploadify-cancel.png',
				queueSizeLimit  : 2,	//上传文件数量限制
				queueID       	: 'fileQueue',		//下载进度展示区
	            fileSizeLimit 	: 512 * 1024,	//上传文件大小限制(k)
	            progressData	: 'speed',	//设置显示在上传进度条中的数据类型，可选项时百分比（percentage）或速度（speed）。
	            method 			: 'POST',
	            removeCompleted : false,	//下载完是否删除记录，默认值true
	            onUploadSuccess: function(file, data) {
	                console.log('result:' + data);
	            },
	            onSelect:function(file){
	            	console.log('upload ' + file.name + ',filesize:' + file.size + 'k.');
	            },
	            //检测FLASH失败调用
	            onFallback:function(){
	                alert("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试。");
	            },
			});
		});
	</script>
</body>
</html>